package com.hnvec.xiewenguang;

public class Example11 {
    public static void main(String[] args){
        int[] arr = {30,46,20,19,61,45};
        int min = getMin(arr);//静态初始值数组
        System.out.println(min);

    }

    //不管三七二十一，随便拿一个元素作为比较值
    public static int getMin(int[] arr){
        int min = arr[2];
        for (int i = 0; i< arr.length;i++){

            if (min > arr[i]){
                min = arr[i];

            }

        }
        return min;
    }
}


